package com.example.finance_oa.controller;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
import com.example.comment_oa.pojos.Budget;
import com.example.comment_oa.response.AjaxResponse;
import com.example.finance_oa.dubbo.AccountListener;
import com.example.finance_oa.mapper.BudgetMapper;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@CrossOrigin
@RequestMapping("/financeOa")
public class BudgetController1 {
    @Resource
    BudgetMapper budgetMapper;
    @RequestMapping("budget/daoru")
    public AjaxResponse daoru(@RequestParam("files") MultipartFile files) throws IOException {
            ExcelReaderBuilder hh= EasyExcel.read(files.getInputStream(), Budget.class,
                    new AccountListener(budgetMapper));
            hh.sheet().doRead();
            return AjaxResponse.success("11");
    }



}
